/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.ArrayList;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.List;
import javax.persistence.OneToMany;

/**
 *
 * @author Dao Thai Duy
 */
@Entity
public class TableTypeEntity implements Serializable {

    private static long serialVersionUID = 1L;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public static void setSerialVersionUID(long aSerialVersionUID) {
        serialVersionUID = aSerialVersionUID;
    }
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String name;
    private int unitCapacity;
    private String imageURL;
    private String description;
    @OneToMany(mappedBy = "tableType")
    private List<CapacityControlEntity> capacityControl = new ArrayList<CapacityControlEntity>();
    @OneToMany(mappedBy = "tableType")
    private List<ReservedTableEntity> reservedTable = new ArrayList<ReservedTableEntity>();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (getId() != null ? getId().hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TableTypeEntity)) {
            return false;
        }
        TableTypeEntity other = (TableTypeEntity) object;
        if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.TableType[ id=" + getId() + " ]";
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getUnitCapacity() {
        return unitCapacity;
    }

    public void setUnitCapacity(int unitCapacity) {
        this.unitCapacity = unitCapacity;
    }

    public List<CapacityControlEntity> getCapacityControl() {
        return capacityControl;
    }

    public void setCapacityControl(ArrayList<CapacityControlEntity> capacityControl) {
        this.capacityControl = capacityControl;
    }

    public List<ReservedTableEntity> getReservedTable() {
        return reservedTable;
    }

    public void setReservedTable(ArrayList<ReservedTableEntity> reservedTable) {
        this.reservedTable = reservedTable;
    }

    public String getImageURL() {
        return imageURL;
    }

    public void setImageURL(String imageURL) {
        this.imageURL = imageURL;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
